#ifndef CINDATAMAP_H
#define CINDATAMAP_H
#include "common.h"
#include "NetPacket.h"
#include <unordered_map>
#include <mutex>   



typedef struct{
	char m_cbDataBuf[NET_PACKET_SIZE];
	int	 m_nRecvSize;
} DataItem;



class CinDataMap
{
private:
    unordered_map<int, DataItem> mData;
    std::mutex mtx;
    static CinDataMap* mInstance;

private:
    CinDataMap(/* args */);
    ~CinDataMap();

public:  
    static CinDataMap* GetInstance();
    DataItem findDataByid(int fd);
    void addData(int fd, DataItem item);
    void removeData(int fd);
};




#endif